package com.kucun.service.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.kucun.Dao.UnitsMapper;
import com.kucun.bean.Page;
import com.kucun.bean.Units;
import com.kucun.service.UnitsService;

@Service
@Transactional 
public class UnitsServiceImp implements UnitsService {
	@Resource
	private UnitsMapper unitsMapper;
	public Integer save(Units units) {
		return unitsMapper.insert(units);
	}

	public Integer update(Units units) {
		return unitsMapper.updateByPrimaryKey(units);
	}

	public Integer updateGoodsForDel(String ids) {
		return unitsMapper.updateGoodsForDel(ids);
	}

	public Integer delete(int id) {
		return unitsMapper.deleteByPrimaryKey(id);
	}

	public Units findById(int id) {
		
		return unitsMapper.selectByPrimaryKey(id);
	}

	public List<Units> findAll(Page page) {
		return unitsMapper.findAll(page);
	}

	public Page getCount() {
		
		return unitsMapper.getCount();
	}

	public Integer updateByPrimaryKeySelective(Units units) {
		
		return unitsMapper.updateByPrimaryKeySelective(units);
	}

	public List<Units> findAllDateNoPaging() {
		return unitsMapper.findAllDateNoPaging();
	}


	


}
